package com.example.service;

import com.example.domain.Main;
import com.example.repository.MainRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by 李强 on 2017/4/29.
 */
@Service
public class MainService {
    @Autowired
    private MainRepository mainRepository;
  // @Transactional
    public void  insertTow(){
        Main mains=new Main();
        mains.setAge(18);
        mains.setCupSize("A");
      mainRepository.save(mains);

        Main mainb=new Main();
        mainb.setAge(19);
        mainb.setCupSize("B");
        mainRepository.save(mainb);
    }
}
